<?php

namespace apiend\modules\doc\controllers;

use Yii;
use apiend\components\Controller;
use apiend\modules\doc\models\AssistViewSearch;

/**
 * 详情相关接口
 * 
 * @author emhome <emhome@163.com>
 * @since 1.0
 */
class AssistController extends Controller {

    /**
     * @inheritdoc
     */
    protected function verbs() {
        return [
            '*' => ['GET'],
        ];
    }

    /**
     * 默认接口
     * @inheritdoc
     */
    public function actionView($id) {
        $alias = 't';
        $condition = [];
        if (is_numeric($id)) {
            $condition[$alias . '.id'] = $id;
        } else {
            $condition[$alias . '.name'] = $id;
        }
        return AssistViewSearch::findOfSite($alias, $condition)->one();
    }

}
